package coreio

import "io"

// 从 src 读取，并写入到 to
func WriteTo(src io.Reader, to ...io.Writer) (int64, error) {
	if n := len(to); n <= 0 {
		return 0, ErrNilWriter
	} else if n == 1 {
		return io.Copy(to[0], src)
	}
	return io.Copy(io.MultiWriter(to...), src)
}
